package com.yonyou.cyxdms.sysAuth.service.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;

import java.io.Serializable;

/**
 * <p>
 * 职位与组织部门关系
 * </p>
 *
 * @author adu
 * @since 2019-08-29
 */
@TableName("tm_org_position_dept")
public class OrgPositionDeptPO extends DMSBasePO<OrgPositionDeptPO> {

    private static final long serialVersionUID = 1L;

    /**
     * 职位主键
     */
    @TableField("POSITION_ID")
    private Integer positionId;
    /**
     * 部门组织主键
     */
    @TableField("ORGDEPT_ID")
    private Integer orgdeptId;

    @TableField("APP_ID")
    private String appId;

    @Override
    public String toString() {
        return "OrgPositionDeptPO{" +
                "positionId=" + positionId +
                ", orgdeptId=" + orgdeptId +
                ", appId='" + appId + '\'' +
                '}';
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public OrgPositionDeptPO() {
        super();
    }


    public Integer getPositionId() {
        return positionId;
    }

    public void setPositionId(Integer positionId) {
        this.positionId = positionId;
    }

    public Integer getOrgdeptId() {
        return orgdeptId;
    }

    public void setOrgdeptId(Integer orgdeptId) {
        this.orgdeptId = orgdeptId;
    }


    @Override
    protected Serializable pkVal() {
        return this.positionId;
    }


    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author quankk
     * @since 2018/7/22 0022
     */
    protected <T extends BaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "positionId");
    }


}
